import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

class MLWebViewController extends StatefulWidget {
  final String url;
  final String title;
  MLWebViewController({Key key, this.url, this.title}) : super(key: key);

  @override
  _MLWebViewControllerState createState() => _MLWebViewControllerState();
}

class _MLWebViewControllerState extends State<MLWebViewController> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        title: Text(
          widget.title,
          style: TextStyle(
            color: Colors.black,
            fontSize: 17.0,
          ),
        ),
      ),
      body: WebView(
        initialUrl: widget.url,
        javascriptMode: JavascriptMode.unrestricted,
        // 拦截url
        // navigationDelegate: (NavigationRequest request){
          
        // },
      ),
    );
  }
}
